package ca.qc.bdeb.info.pp2.tp2.application;

import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;

public class ProvinceDAO
{
    public static List<Province> listerProvince(int idPays)
    {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        Query query = session.createQuery("from Province where id_pays=:pays");
        query.setInteger("pays", idPays);
        return (List<Province>) (query.list());
    }
}
